<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/views1/DTD/views1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

	<ui:composition template="/views/layout/main.xhtml">
		<ui:define name="conteudo">
			<h:form id="formPrincipal">
				<div class="grid_18 div_48">
					<p:commandButton widgetVar="btn_Salvar" ajax="false" styleClass="save" 
						action="#{disciplinaBean.salvar}" title="Salvar" />
					<p:commandButton widgetVar="btn_Desistir" ajax="false" styleClass="cancel" 
						immediate="true" action="#{disciplinaBean.desistirEdit}"
						title="Cancelar" />
				</div>

				<div class="grid_18 titulo">Disciplinas</div>

				<div class="grid_18">
					<p:messages id="mensages"/>
				</div>

				<div class="grid_4 div-label">Código:</div>
				<div class="grid_14 div-campo">
					<p:inputText id="disciplina_codigo" 
						widgetVar="disciplina_codigo" styleClass="input-mp"
						value="#{disciplinaBean.disciplinaInstance.codigo}" />
				</div>

				<div class="grid_4 div-label">Nome:</div>
				<div class="grid_14 div-campo">
					<p:inputText id="disciplina_nome" required="true"
						requiredMessage="O campo 'Nome' não pode ser nulo!"
						widgetVar="disciplina_nome" styleClass="input-mg"
						value="#{disciplinaBean.disciplinaInstance.nome}" />
				</div>

				<div class="grid_4 div-label">Carga Horária:</div>
				<div class="grid_14 div-campo">
					<p:inputMask id="disciplina_cargaHoraria" mask="?999" maxlength="3" 
						widgetVar="disciplina_cargaHoraria" styleClass="input-mp"
						value="#{disciplinaBean.disciplinaInstance.cargaHoraria}" />
				</div>

				<div class="grid_4 div-label">Situação:</div>
				<div class="grid_14 div-campo">
					<h:selectOneMenu styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all input-mp" id="disciplina_situacao" value="#{disciplinaBean.disciplinaInstance.situacao}"
					converter="situDisciplina">
						<f:selectItems var="var" value="#{enumBean.situDisciplina}"/>
				 	</h:selectOneMenu>
				</div>
				
				<div class="grid_4 div-label">Descrição:</div>
				<div class="grid_14 div-campo">
					<p:editor id="disciplina_descricao" 
						widgetVar="disciplina_descricao" 
						value="#{disciplinaBean.disciplinaInstance.descricao}" />
				</div>
			</h:form>
		</ui:define>
	</ui:composition>
</f:view>